export default class Stack<T>{
    private items: Array<T>; 

    constructor(){
        this.items = new Array<T>();
    }
    public get Count():number{
        return this.items.length;
    }
    //入栈
    public Push(element: T) {
        this.items.push(element);
    }

    //获得并移数组的最后一个元素
    public Pop(): T {
        return this.items.pop();
    }

    //获得不移除数组的最后一个元素
    public Peek():T{
        return this.items[this.Count -1];
    }
}